package com.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.WeightedResponseTimeRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: ruiyanglee
 * @date: 2020-11-06 23:51
 * @description: 自定义负载均衡算法
 */

@Configuration
public class MySelfRule {

    @Bean
    public IRule getRule() {
        // 能者多劳算法
        return new WeightedResponseTimeRule();
    }
}
